package com.cimp.domain.tools;

/**
 * [简要描述]: 升级结果
 * [详细描述]:
 *
 * @author huojinhao
 * @date 2018/11/14
 */
public class UpgradeResult {

    private UpgradeResult(String type, String message, int active) {
        this.type = type;
        this.message = message;
        this.active = active;
    }

    public static UpgradeResult step(int step){
        return new UpgradeResult("step", null, step);
    }

    public static UpgradeResult ing(){
        return new UpgradeResult("ing", null, 0);
    }

    public static UpgradeResult error(String errorMsg){
        return new UpgradeResult("error", errorMsg, 0);
    }

    public static UpgradeResult init(String message){
        return new UpgradeResult("init", message, -1);
    }

    private String type;

    private String message;

    private int active;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getActive() {
        return active;
    }

    public void setActive(int active) {
        this.active = active;
    }
}
